﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Windows.Forms;
using System.ComponentModel;

namespace AMS.UI.Controls
{
    public class TabControlEx : System.Windows.Forms.TabControl
    {
        public TabControlEx()
        {
        }

        Size actualSize = new Size(0, 1);

        [DefaultValue(TabAppearance.FlatButtons)]
        public new TabAppearance Appearance
        {
            get
            {
                if (ControlUtility.DesignMode)
                {
                    return base.Appearance;
                }
                else
                {
                    return TabAppearance.FlatButtons;
                }
            }
            set
            {
                if (ControlUtility.DesignMode)
                {
                    base.Appearance = value;
                }
                else
                {
                    base.Appearance = TabAppearance.FlatButtons;
                }
            }
        }

        [DefaultValue(TabSizeMode.Fixed)]
        public new TabSizeMode SizeMode
        {
            get
            {
                if (ControlUtility.DesignMode)
                {
                    return base.SizeMode;
                }
                else
                {
                    return TabSizeMode.Fixed;
                }
            }
            set
            {
                if (ControlUtility.DesignMode)
                {
                    base.SizeMode = value;
                }
                else
                {
                    base.SizeMode = TabSizeMode.Fixed;
                }
            }
        }

        public new Size ItemSize
        {
            get
            {
                if (ControlUtility.DesignMode)
                {
                    return base.ItemSize;
                }
                else
                {
                    return actualSize;
                }
            }
            set
            {
                if (ControlUtility.DesignMode)
                {
                    base.ItemSize = value;
                }
                else
                {
                    base.ItemSize = actualSize;
                }
            }
        }
    }
}
